//
//  UserInfoModel.m
//  Ranging_dev
//
//  Created by Mr.Dynasty on 2019/4/1.
//  Copyright © 2019 Mr.Dynasty. All rights reserved.
//

#import "UserInfoModel.h"

@implementation UserInfoModel

- (NSMutableDictionary *)convert2Dictionary {
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
    //当前对象属性列表
    unsigned int selfCount = 0;
    objc_property_t *selfPropertyList = class_copyPropertyList([self class],&selfCount);
    for(int i = 0; i < selfCount; i++){
        objc_property_t currProperty = selfPropertyList[i];
        NSString *currPropertyName = [NSString stringWithFormat:@"%s", property_getName(currProperty)];
        id value = [self valueForKey:currPropertyName];
        [dic setValue:value forKey:currPropertyName];
    }
    free(selfPropertyList);
    return dic;
}

@end
